<?php

namespace fastphp\util;

class Utils
{
    public static function array_unique_multidimensional($array): array
    {
        $uniqueArray = [];
        $serializedArray = [];

        foreach ($array as $subArray) {
            // 将子数组序列化为字符串，以便比较
            $serialized = serialize($subArray);

            // 如果序列化后的字符串不在$serializedArray中，则添加到$uniqueArray
            if (!in_array($serialized, $serializedArray)) {
                $uniqueArray[] = $subArray;
                $serializedArray[] = $serialized;
            }
        }

        return $uniqueArray;
    }
}